<template>
	<view class="goods">
		<uni-nav-bar :fixed="true" left-icon="back"  :border="false"backgroundColor="#f9f2ea" leftText="物流详情" :statusBar="true" @clickLeft="goBack"></uni-nav-bar>
		<view class="logistics" v-for="(items, index) in logisticsList" :key="index">
			<view class="logistics-title">
				<view class="">
					物流公司：{{items.shipping_name}}
				</view>
				<view class="">
					订单编号：{{items.shipping_no}}
				</view>
			</view>
			<view class="logistics-item" v-for="(item, idx) in items.list" :key="idx">
				<view class="">
					{{item.AcceptStation}}
				</view>
				<view class="">
					{{item.AcceptTime}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { searchLogistics } from "@/api/public.js"
	export default {
		data(){
			return {
				id: "",
				logisticsList: [],
			}
		},
		methods: {
			goBack(){
				uni.navigateBack();
			},
			getLogistics(){
				searchLogistics(this.id).then(res=>{
					let arr = res.reData.data;
					for(let i in arr){
						arr[i].list = [];
						for(let j = arr[i].trace.length - 1;j >= 0; j--){
							arr[i].list.push(arr[i].trace[j])
						}
					}
					this.logisticsList = arr;
				})
			},
		},
		onLoad(obj){
			this.id = obj.id
			this.getLogistics();
		},
	}
</script>

<style lang="scss" scoped>
.goods{
	height: 100%;
	padding: 0rpx 30rpx;
	margin-bottom: 30rpx;
	.logistics{
		.logistics-title{
			padding: 20rpx 0;
			color: #666;
			line-height: 34rpx;
			font-size: 24rpx;
		}
		.logistics-item{
			padding: 20rpx 0;
			color: #666;
			line-height: 34rpx;
			font-size: 24rpx;
		}
	}
}
</style>
